/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.exam;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Random;

/**
 * <p>Project: javase - Ex2
 * <p>Powered by webrx On 2021-12-14 19:05:30
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex2 {
    public static void main(String[] args) {
        Random rand = new Random();
        StringBuilder sbu = new StringBuilder();
        for (int i = 1; i < 10000; i++) {
            int a = rand.nextInt(33);
            int b = rand.nextInt(33);
            String c = String.format("%2d × %2d =     ", a, b);
            sbu.append(c);
            if (i % 4 == 0) {
                sbu.append("\r\n");
            }
        }
        try (var f = new FileOutputStream("c:/32.txt")) {
            f.write(sbu.toString().getBytes());
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
